/**
 * 
 */
package edu.unicen.compilers.actions;

import edu.unicen.compilers.lexicon.LexicalAnalyzer;
import edu.unicen.compilers.parser.Parser;

/**
 * @author Emiliano
 *
 */
public class SemanticAction8 extends SemanticAction {

	/**
	 * @param la
	 */
	public SemanticAction8(LexicalAnalyzer la, Parser parser) {
		super(la, parser);
	}

	/* (non-Javadoc)
	 * @see edu.unicen.compilers.actions.SemanticAction#execute()
	 */
	@Override
	public void execute() {
		String lexem=la.getPartialLexeme()+la.getLastCharacter();
		la.setLexeme(la.getPartialLexeme()+la.getLastCharacter());
		la.setLastCharacter('\0');
		if (lexem.equalsIgnoreCase("!="))
			la.setToken(DISTINTO);
		if (lexem.equalsIgnoreCase("=="))
			la.setToken(IGUAL);
		if (lexem.equalsIgnoreCase("<="))
			la.setToken(MENORIGUAL);
		if (lexem.equalsIgnoreCase(">="))
			la.setToken(MAYORIGUAL);
	}

}
